package com.frxuexi.lib_base.db

import androidx.room.Dao
import androidx.room.Delete
import androidx.room.Insert
import androidx.room.OnConflictStrategy
import androidx.room.Query
import androidx.room.Update
import com.frxuexi.lib_base.entity.RepairBeanItem

@Dao
interface RepairDao {

    @Insert(onConflict = OnConflictStrategy.REPLACE)
    fun insertRepair(item: RepairBeanItem):Long

    @Query("select * from RepairBeanItem")
    fun getRepairs():List<RepairBeanItem>

    @Query("select * from repairbeanitem where id=:id")
    fun getRepairById(id:Int):RepairBeanItem

    @Delete
    fun deleteRepair(item: RepairBeanItem):Int

    @Update
    fun updateRepair(item: RepairBeanItem):Int
}